-
Notifications
You must be signed in to change notification settings - Fork 598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(parser): simplify parser test #16942
Conversation
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
let update = std::env::var("UPDATE_PARSER_TEST").is_ok(); | ||
std::env::set_current_dir("tests/testdata").unwrap(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about relying on expect_test
to update result?
risingwave/src/frontend/planner_test/src/lib.rs
Lines 95 to 98 in e16812b
pub fn check(actual: Vec<TestCaseResult>, expect: expect_test::ExpectFile) { | |
let actual = serde_yaml::to_string(&actual).unwrap(); | |
expect.assert_eq(&format!("# This file is automatically generated. See `src/frontend/planner_test/README.md` for more information.\n{}",actual)); | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find that it's not a good idea to use expect_test
as it can not show diff one case at a time. Multiple cases would mix together. I'm going to revert this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a known issue #10940 🤪
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mainly just blindly update the tests and rely on git diff to see what's changed.
Signed-off-by: Runji Wang <[email protected]>
This reverts commit 29de738.
Signed-off-by: Runji Wang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rubber stamp
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This PR removes crate
sqlparser/test_runner
and merges its code into a single filesqlparser/tests/parser_test.rs
. This way, these test cases can be included when runningcargo test -p risingwave_sqlparser
.This PR also uses libtest-mimic for a better UI, removes multistage
apply-parser-test
,do-apply-parser-test
, and keepsupdate-parser-test
only.Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.